<script>
	//OneWay - RoundTrip control
	$(document).ready(function() {
		if ($("input[name=typeOfTrip]:checked").val() == "oneWay") {
			$("#lbReturn").hide();
			$("#dpd2").hide();
			$("#dpd2").removeAttr("required");
		}
		$(".radioBtn").click(function() {
			$('#txttypeOfTrip').val($("input[name=typeOfTrip]:checked").val());
			$("#dpd2").show();
			$("#lbReturn").show();
			$("#dpd2").attr("required");
			if ($("input[name=typeOfTrip]:checked").val() == "oneWay") {
				$("#lbReturn").hide();
				$("#dpd2").hide();
				$("#dpd2").removeAttr("required");
				$('#txtinBound').val('');
			}
			if ($("input[name=typeOfTrip]:checked").val() == "roundTrip") {
				$("#dpd2").attr("required","required");
			}
		});
	});
	function selectTypeOfTrip(TypeOfTrip){
		$('#txttypeOfTrip').val($("input[name=typeOfTrip]:checked").val());
		$("#dpd2").show();
		$("#lbReturn").show();
		$("#dpd2").attr("required");
		if(TypeOfTrip.id=='roundtrip'){
			$("#RoundTripRadio").attr('checked',true);
			$("#RoundTripRadio")[0].checked = true;
			$("#OneWayRadio").removeAttr('checked');
			$("#dpd2").attr("required", "required");
		}else{
			$("#OneWayRadio").attr('checked',true);
			$("#OneWayRadio")[0].checked = true;
			$("#RoundTripRadio").removeAttr('checked');
			$("#lbReturn").hide();
			$("#dpd2").hide();
			$("#dpd2").removeAttr("required");
			$('#txtinBound').val('');
		}
	}
</script>
